import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

/*
normalize.css
1:安装  npm i normalize.css
2:导入  import "normalize.css"
*/

import 'normalize.css'
// 公共样式处理
import '@/assets/styles/common.less'

// Vue.component(组件名,导入的组件)
// import XtxSkeleton from '@/components/library/xtx-skeleton.vue'
// const app = createApp(App)
// app.component(XtxSkeleton.name, XtxSkeleton)
/*
app.use({install(app,options){
app.component(组件名,导入的组件)
}},options)

app.use(function(app,options){
app.component(组件名,导入的组件)
},options)
*/
import componentJs from '@/components/library/index.js'
// 全局注册自定义指令
import directives from '@/directives'
const app = createApp(App)
// app.directive(指令名，{生命周期})
// for (const key in directives) {
//   app.directive(key, directives[key])
// }
Object.keys(directives).forEach(key => {
  app.directive(key, directives[key])
})
app
  .use(store)
  .use(router)
  .use(componentJs)
  .mount('#app')
